# Maintainer: Dan Printzell <wild@archlinux.org>
# Maintainer: Filipe Laíns (FFY00) <lains@archlinux.org>
# Contributor: dsboger <https://github.com/dsboger>
# Contributor: Carl George < arch at cgtx dot us >

pkgname=tilix
pkgver=1.9.6
pkgrel=1
pkgdesc="A tiling terminal emulator for Linux using GTK+ 3"
arch=('loong64' 'x86_64')
url="https://github.com/gnunn1/tilix"
license=('MPL')
depends=('libx11' 'gtkd' 'vte3' 'dconf' 'gsettings-desktop-schemas')
makedepends=('ldc' 'po4a' 'meson' 'appstream')
optdepends=('python-nautilus: for "Open Tilix Here" support in nautilus'
            'libsecret: for the password manager')
source=(
  "$url/archive/$pkgver/$pkgname-$pkgver.tar.gz"
)
sha256sums=('be389d199a6796bd871fc662f8a37606a1f84e5429f24e912d116f16c5f0a183')

build() {
  mkdir build
  cd build

  # Build with LDC
  export DC=ldc
  export LDFLAGS="$(echo -ne $LDFLAGS | sed -e 's/-flto=auto//')"
  export DFLAGS="--flto=full"

  arch-meson ../$pkgname-$pkgver

  ninja
}

package() {
  cd build

  DESTDIR="$pkgdir" ninja install
}
